import Vue from 'vue';
import VueRouter, { RouteConfig } from 'vue-router';

Vue.use(VueRouter);

const routes: Array<RouteConfig> = [
  {
    path: '/',
    name: 'Login',
    component: () => import('../views/login/index.vue')
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import('../views/home/index.vue'), // 引入布局组件
    children: [
      {
        path: '/users',
        name: 'Users',
        component: () => import('../views/users/index.vue'), // 用户管理页面
      }
    ]
  },
];

const router = new VueRouter({
  routes,
});

export default router;
